package com.smooth.dao.gen;

import com.smooth.dao.gen.bean.BizGoods;
import com.smooth.dao.gen.bean.BizGoodsExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BizGoodsMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_goods
     */
    @SelectProvider(type=BizGoodsSqlProvider.class, method="countByExample")
    long countByExample(BizGoodsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_goods
     */
    @DeleteProvider(type=BizGoodsSqlProvider.class, method="deleteByExample")
    int deleteByExample(BizGoodsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_goods
     */
    @Delete({
        "delete from biz_goods",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_goods
     */
    @Insert({
        "insert into biz_goods (id, good_title, ",
        "good_pic, good_pics, ",
        "good_desc, price_jifen, ",
        "good_status, good_type, ",
        "sell_type, start_time, ",
        "end_time, good_category_id, ",
        "good_category_name, stock_num, ",
        "create_date, update_date)",
        "values (#{id,jdbcType=VARCHAR}, #{goodTitle,jdbcType=VARCHAR}, ",
        "#{goodPic,jdbcType=VARCHAR}, #{goodPics,jdbcType=VARCHAR}, ",
        "#{goodDesc,jdbcType=LONGVARCHAR}, #{priceJifen,jdbcType=INTEGER}, ",
        "#{goodStatus,jdbcType=SMALLINT}, #{goodType,jdbcType=SMALLINT}, ",
        "#{sellType,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP}, ",
        "#{endTime,jdbcType=TIMESTAMP}, #{goodCategoryId,jdbcType=VARCHAR}, ",
        "#{goodCategoryName,jdbcType=VARCHAR}, #{stockNum,jdbcType=INTEGER}, ",
        "#{createDate,jdbcType=TIMESTAMP}, #{updateDate,jdbcType=TIMESTAMP})"
    })
    int insert(BizGoods record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_goods
     */
    @InsertProvider(type=BizGoodsSqlProvider.class, method="insertSelective")
    int insertSelective(BizGoods record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_goods
     */
    @SelectProvider(type=BizGoodsSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="good_title", property="goodTitle", jdbcType=JdbcType.VARCHAR),
        @Result(column="good_pic", property="goodPic", jdbcType=JdbcType.VARCHAR),
        @Result(column="good_pics", property="goodPics", jdbcType=JdbcType.VARCHAR),
        @Result(column="good_desc", property="goodDesc", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="price_jifen", property="priceJifen", jdbcType=JdbcType.INTEGER),
        @Result(column="good_status", property="goodStatus", jdbcType=JdbcType.SMALLINT),
        @Result(column="good_type", property="goodType", jdbcType=JdbcType.SMALLINT),
        @Result(column="sell_type", property="sellType", jdbcType=JdbcType.INTEGER),
        @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="good_category_id", property="goodCategoryId", jdbcType=JdbcType.VARCHAR),
        @Result(column="good_category_name", property="goodCategoryName", jdbcType=JdbcType.VARCHAR),
        @Result(column="stock_num", property="stockNum", jdbcType=JdbcType.INTEGER),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP)
    })
    List<BizGoods> selectByExample(BizGoodsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_goods
     */
    @Select({
        "select",
        "id, good_title, good_pic, good_pics, good_desc, price_jifen, good_status, good_type, ",
        "sell_type, start_time, end_time, good_category_id, good_category_name, stock_num, ",
        "create_date, update_date",
        "from biz_goods",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="good_title", property="goodTitle", jdbcType=JdbcType.VARCHAR),
        @Result(column="good_pic", property="goodPic", jdbcType=JdbcType.VARCHAR),
        @Result(column="good_pics", property="goodPics", jdbcType=JdbcType.VARCHAR),
        @Result(column="good_desc", property="goodDesc", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="price_jifen", property="priceJifen", jdbcType=JdbcType.INTEGER),
        @Result(column="good_status", property="goodStatus", jdbcType=JdbcType.SMALLINT),
        @Result(column="good_type", property="goodType", jdbcType=JdbcType.SMALLINT),
        @Result(column="sell_type", property="sellType", jdbcType=JdbcType.INTEGER),
        @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="good_category_id", property="goodCategoryId", jdbcType=JdbcType.VARCHAR),
        @Result(column="good_category_name", property="goodCategoryName", jdbcType=JdbcType.VARCHAR),
        @Result(column="stock_num", property="stockNum", jdbcType=JdbcType.INTEGER),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP)
    })
    BizGoods selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_goods
     */
    @UpdateProvider(type=BizGoodsSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BizGoods record, @Param("example") BizGoodsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_goods
     */
    @UpdateProvider(type=BizGoodsSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BizGoods record, @Param("example") BizGoodsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_goods
     */
    @UpdateProvider(type=BizGoodsSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BizGoods record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_goods
     */
    @Update({
        "update biz_goods",
        "set good_title = #{goodTitle,jdbcType=VARCHAR},",
          "good_pic = #{goodPic,jdbcType=VARCHAR},",
          "good_pics = #{goodPics,jdbcType=VARCHAR},",
          "good_desc = #{goodDesc,jdbcType=LONGVARCHAR},",
          "price_jifen = #{priceJifen,jdbcType=INTEGER},",
          "good_status = #{goodStatus,jdbcType=SMALLINT},",
          "good_type = #{goodType,jdbcType=SMALLINT},",
          "sell_type = #{sellType,jdbcType=INTEGER},",
          "start_time = #{startTime,jdbcType=TIMESTAMP},",
          "end_time = #{endTime,jdbcType=TIMESTAMP},",
          "good_category_id = #{goodCategoryId,jdbcType=VARCHAR},",
          "good_category_name = #{goodCategoryName,jdbcType=VARCHAR},",
          "stock_num = #{stockNum,jdbcType=INTEGER},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(BizGoods record);
}